var csInterface = new CSInterface();

// 个人主页
var homePageElement = document.querySelector("#homePage");
homePageElement.addEventListener("click", callHomepage);

function callHomepage() {
  window.cep.util.openURLInDefaultBrowser("https://gitee.com/brzjomo");
}

//调用函数
var runButtonAddLayer = document.querySelector("#run-button-addLayer");
runButtonAddLayer.addEventListener("click", addLayer);

function addLayer() {
  // 获取预设
  var presetElement = document.getElementById("preset");
  var preset = parseFloat(
    presetElement.options[presetElement.selectedIndex].value
  );

  // 传递参数
  csInterface.evalScript("addLayer(" + preset + ")");
}
